package com.wanggan.rmi.service.impl;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import com.wanggan.rmi.model.User;
import com.wanggan.rmi.service.UserService;

/**
 * @author wanggan
 */
public class UserServiceImpl extends UnicastRemoteObject implements UserService {
    
    
    public UserServiceImpl() throws RemoteException {
    }
    
    private static User user = new User(1,"test@qq.com",20,"18428326494");
    
    @Override
    public User getById(Integer id) throws RemoteException {
        return user;
    }
    
    @Override
    public User getByUsername(String username) throws RemoteException {
        return user;
    }
    
    @Override
    public int getUserCount() throws RemoteException {
        return 1;
    }
}
